Support Laravel 13 - #228
austinderrick wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR upgrades Winter CMS Storm to require PHP 8.3 minimum, updates CI workflows and composer dependencies to match, refines PHPDoc type annotations to document Eloquent Builder generics consistently across Preferences and relation factories, implements lazy initialization for ArraySource SQLite connections to defer boot until first use, adjusts DownCommand payload generation logic, removes four now-resolved PHPStan baseline suppressions, and updates test expectations for scheduled call output formatting. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
415c0c6 to
0156a54
Compare
0156a54 to
743afcd
Compare
743afcd to
61dd62a
Compare
Move Storm to Laravel 13 (PHP 8.3+): bump the framework, Tinker, Carbon, Symfony, PHPUnit and Testbench constraints, build the ArraySource datasource lazily with a connection per model class, alias the log service to LogManager, use getSecret() in DownCommand, add the relation factory Builder<Model> docblocks, and update the PHPStan baseline and CI matrix.
0808f83 to
a2b45fe
Compare
Move Winter to Laravel 13 (PHP 8.3+): bump the framework and PHPUnit constraints in the root and module manifests, use Arr::last() in VersionManager, resolve Storm and the modules from the Laravel 13 branches until wintercms/storm#228 merges, and update the CI matrix.
…ercms#247) (cherry picked from commit c415db8)
Builds on #207 (Laravel 12 support) and continues the 1.3 line. This PR moves Storm to Laravel 13.
Required by wintercms/winter#1487 (Winter CMS Laravel 13 support).
Summary
Laravel 13 was released on 2026-03-17 and requires PHP 8.3. Storm overrides several framework internals, so this PR has four code changes as well as the dependency updates.
Dependency changes (
composer.json)php:^8.2→^8.3(the Laravel 13 minimum)laravel/framework:^12.30.1→^13.0laravel/tinker:^2.8.1→^3.0nesbot/carbon:^3.0→^3.8.4symfony/console,symfony/processandsymfony/yaml: →^7.4|^8.0orchestra/testbench:^10.0→^11.0phpunit/phpunit:^11.0→^11.5.50. Laravel 13 and Testbench 11 require at least 11.5.50. PHPUnit stays on 11.x becausemeyfa/phpunit-assert-gdanddms/phpunit-arraysubset-assertshave no PHPUnit 12 release yet.pieterocp/phpunit-arraysubset-assertsVCS repository now sets"no-api": true. Composer then clones it with plain git, so installs work without a GitHub API token. CI for pull requests from forks has no token.Code changes
ArraySourcetrait. Laravel 13 throws aLogicExceptionwhen a model is instantiated while it is still booting.bootArraySource()created the SQLite datasource during boot, which callsnew staticandstatic::insert(). The datasource is now built lazily, the first timeresolveConnection()is called for the model, when the model has finished booting.bootArraySource()discards the class's connection. AfterModel::clearBootedModels(), the next query rebuilds the datasource, as it did when boot built it.ApplicationExceptioninstead of infinite recursion.logalias (Foundation/Application). Storm aliased thelogservice toIlluminate\Log\Logger, but the service is aLogManager. ResolvingIlluminate\Log\Loggertherefore returned aLogManager, and code that type-hintsLoggerfailed with aTypeError. Laravel Debugbar 4's log collector does this. The alias is nowIlluminate\Log\LogManager, which matches Laravel core.Foundation/Console/DownCommand. Laravel 13 added--with-secrettodown. The override now passes$this->getSecret()instead of$this->option('secret'), so a generated secret works.getSecret()also exists in Laravel 12.Database/Concerns/HasRelationships.phpnow declare@param Builder<Model> $query, so the builder they pass matches the relation constructors.Auth/Models/Preferencesnow documents itsapplyKeyAndUserscope as returningBuilder<static>. Entries that no longer match were removed fromphpstan-baseline.neon, and theMailFake::queueentry was updated to Laravel 13's signature.CI
tests.yml: the PHP matrix drops 8.2 and is now['8.3', '8.4', '8.5'].code-quality.yaml: PHP8.2→8.3.Testing
Run locally on PHP 8.4 with Laravel 13.33.0 and PHPUnit 11.5.56:
vendor/bin/phpunit: 850 tests, 0 failures, 9 skipped.tests/Database/Traits/ArraySourceTest.phphas two new tests. The first checks that a subclass of anArraySourcemodel reads its own records. The second checks that the datasource is rebuilt afterModel::clearBootedModels(). Both tests fail without the per-class connections.ArraySource.php.MarkdownTest(thesimple_tablecase) fails on any fresh install that resolvesleague/commonmark2.10.2 or later, because those releases changed how tables are parsed. This does not come from this PR. Withleague/commonmark2.10.1 installed, the full suite passes as listed above.Related Winter CMS Laravel 13 PRs